home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / GRAPTIES / SD204.LZH / BOX.DOC < prev    next >
Text File  |  1980-01-01  |  60KB  |  1,690 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.                                     BOX
  19.  
  20.                           A Program for Creating
  21.                          and Editing Screen Images
  22.  
  23.                                 version 1.3
  24.  
  25.             (C) Copyright 1986,1987,1988 by Nescatunga Software
  26.                             All Rights Reserved
  27.  
  28.                          Registration Fee: $20.00
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.           =======================================================
  69.           BOX USER GUIDE                                 PAGE 2
  70.           =======================================================
  71.  
  72.  
  73.           TABLE OF CONTENTS
  74.  
  75.  
  76.           License and Registration Information..................3
  77.           Introduction..........................................4
  78.           Making Backup Copies..................................5
  79.           Running BOX on a Floppy-Based System..................5
  80.           Installing BOX on a Hard Disk.........................5
  81.           Running BOX on a Hard Disk System.....................6
  82.           The Main Menu.........................................6
  83.             Draw Menu...........................................7
  84.             Load from Disk......................................8
  85.             Save to Disk........................................8
  86.             ASCII File Format...................................9
  87.             Memory File Format..................................9
  88.             Packed File Format.................................10
  89.             Path/Directory.....................................11
  90.             Clear Screen.......................................11
  91.             Exit Program.......................................11
  92.           The Draw Menu Functions..............................12
  93.             Type Labels........................................12
  94.               Insert Mode (Ins)................................12
  95.               Delete Line (F9).................................13
  96.               Insert Line (F10)................................13
  97.             Draw Boxes.........................................13
  98.             Move...............................................14
  99.             Color Change.......................................14
  100.             Block Functions....................................15
  101.             Select Box Drawing Style...........................16
  102.             Repeat.............................................16
  103.             Paint Areas........................................17
  104.             Erase..............................................18
  105.             On the Fly Changes.................................19
  106.              ASCII Table.......................................19
  107.           Turbo Pascal Programming Considerations..............20
  108.             Displaying ASCII Format Screens....................20
  109.             Displaying Memory Format Screens...................20
  110.             Displaying Packed Format Screens...................21
  111.             Using BOX Screens for Context Sensitive Help.......21
  112.           Address.Pas, a Complete Example Program..............23
  113.           Capturing screens from other programs with GRAB......23
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.           =======================================================
  135.           BOX USER GUIDE                                 PAGE 3
  136.           =======================================================
  137.  
  138.  
  139.           LICENSE AND REGISTRATION
  140.  
  141.           BOX is user supported software copyrighted by the
  142.           author who reserves all rights.  You are granted a
  143.           limited license to use the program under the terms
  144.           below.
  145.  
  146.           You may copy the BOX disk to evaluate it or to give to
  147.           others to evaluate so long as no price or other
  148.           consideration is charged.
  149.  
  150.           Shareware distribution organizations may copy the BOX
  151.           diskette and share it with their members so long as no
  152.           price is charged other than a reasonable distribution
  153.           fee not to exceed the cost of a diskette and handling.
  154.  
  155.           The program, associated files and documentation must
  156.           always be distributed together.  You may not modify the
  157.           program or the documentation.  You may not reprint the
  158.           program manual in any way.
  159.  
  160.           Schools may copy BOX as many times as needed so long as
  161.           the registration fee has been paid for each building
  162.           the program will be used in.
  163.  
  164.  
  165.           REGISTRATION FEE
  166.  
  167.           If you find BOX useful please register as a BOX user by
  168.           sending $20.00 to:
  169.  
  170.                 Nescatunga Software
  171.                 Box 5942
  172.                 Katy, TX 77450
  173.  
  174.           For registering you will receive the latest version of
  175.           the BOX program and a printed copy of the
  176.           documentation.
  177.  
  178.           Although BOX is relatively small and tightly focused in
  179.           its purpose, it represents many hours of work.  We can
  180.           continue to enhance BOX and develop other shareware
  181.           products ONLY if you support the product and the
  182.           shareware concept.
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.           =======================================================
  201.           BOX USER GUIDE                                 PAGE 4
  202.           =======================================================
  203.  
  204.           INTRODUCTION
  205.  
  206.           BOX and the other programs on this diskette represent a
  207.           sophisticated screen design and display system.  With
  208.           the BOX system you can add eye-popping data entry
  209.           screens and instant context-sensitive help screens to
  210.           your Turbo Pascal and C programs.  The components of
  211.           the system are:
  212.  
  213.             BOX, the world's best screen designing editor.
  214.  
  215.             LOADFILE.PAS, a Pascal Unit which contains complete
  216.             source code for displaying BOX-created screens in
  217.             your programs.  Also on the diskette are several
  218.             other useful Pascal Units such as IOSTUFF and
  219.             MENUBOX.
  220.  
  221.             ADDRESS.PAS, a complete example program in Turbo
  222.             Pascal source code, which shows how to use BOX-
  223.             created screens for program logos, for context
  224.             sensitive help and for database entry.
  225.  
  226.             GRAB, a memory resident screen capture program you
  227.             can use to take snapshots of screens in any program.
  228.  
  229.             Full documentation for all of the above.
  230.  
  231.           The main attraction, however, is BOX, the screen
  232.           editor.  With it you can create snazzy, professional-
  233.           looking data entry screens and help screens in minutes
  234.           rather than hours.
  235.  
  236.           To use BOX you start with a blank screen.  Then, using
  237.           special screen editing functions, you type, paint,
  238.           shade, fill, draw boxes or erase in any color
  239.           combination you desire.  BOX has several unique
  240.           functions such as REPEAT, BLOCK and ASCII-Table-
  241.           Selection which are tailored specifically to screen
  242.           creation and far exceed what is available in text
  243.           editors.  Drawing intricate intersecting boxes is
  244.           literally child's play.
  245.  
  246.           When you've got the screen just right you SAVE the
  247.           screen image to disk.  This screen image file now is
  248.           available to be loaded directly onto the screen from a
  249.           Pascal or C program.  Later if you decide to make
  250.           changes to the screen it is a snap to LOAD it back into
  251.           BOX's editor and make the changes.
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.           =======================================================
  267.           BOX USER GUIDE                                 PAGE 5
  268.           =======================================================
  269.  
  270.           BOX works in regular text mode and uses regular ASCII
  271.           characters so that any BOX-created screen may be
  272.           displayed on any color or monochrome monitor.
  273.  
  274.           Applications for BOX screens include:
  275.  
  276.                 Input screens for data base entry
  277.                 Menus
  278.                 Help Screens
  279.                 Program Logo screens
  280.                 Demonstration Screens
  281.                 Program Prototyping
  282.                 Computer "doodling"
  283.  
  284.           BOX will run on any IBM PC (CGA, EGA or Monochrome)
  285.           under DOS.  We have tested BOX on several IBM
  286.           compatible PCs and have discovered no problems.  Be
  287.           aware however that BOX incorporates several low-level
  288.           functions which may not work on some IBM near-
  289.           compatibles.  Please let us know the nature of any
  290.           problems you discover on your system.
  291.  
  292.           The diskette also contains ADDRESS.PAS, a complete
  293.           example application.  ADDRESS uses BOX screens for its
  294.           program logo, as context-sensitive help screens and as
  295.           a database entry screen.  The ADDRESS program includes
  296.           procedures which pop the BOX-created screens onto the
  297.           monitor instantly.  You are free to use these
  298.           procedures in your own Turbo Pascal programs.  The
  299.           procedures are not complicated and could be easily
  300.           translated into C for example.
  301.  
  302.           Also included with ADDRESS are several other powerful
  303.           Pascal Units taken from Turbo Overdrive Package, TOP,
  304.           another shareware product from Nescatunga Software.
  305.           The full TOP package costs $20.00 from Nescatunga
  306.           Software and comes with source code and printed
  307.           documentation.
  308.  
  309.           MAKING BACKUP COPIES
  310.  
  311.           BOX is not copy protected so make as many back-up
  312.           copies as you think you will need.  To make back-up
  313.           copies or distribution copies for other users first
  314.           boot up your computer with DOS.  Place the BOX diskette
  315.           in the A drive and a blank, formatted diskette in the B
  316.           drive.  At the A prompt type the following command to
  317.           copy all files from the A diskette to the B diskette:
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.           =======================================================
  333.           BOX USER GUIDE                                 PAGE 6
  334.           =======================================================
  335.  
  336.                 A> COPY A:*.* B:
  337.  
  338.  
  339.           RUNNING BOX ON A FLOPPY-BASED SYSTEM
  340.  
  341.           To use BOX on a floppy disk system first boot up your
  342.           computer with DOS.  Put the BOX diskette in the A drive
  343.           and type the following command at the A prompt:
  344.  
  345.                 A> BOX
  346.  
  347.           The BOX program will start by displaying a logo with
  348.           the word BOX outlined on the screen.  Remember that BOX
  349.           looks for its logo file and its help files on the same
  350.           drive where it is started.  So don't start the program
  351.           from another drive, as shown in the example below.
  352.  
  353.                 B> A:BOX    (Wrong)
  354.  
  355.           After you have started BOX you may easily change the
  356.           default data drive or directory.
  357.  
  358.           INSTALLING BOX ON A HARD DISK
  359.  
  360.           To install BOX on a hard disk first make a new
  361.           directory to hold the BOX files.  Change to that
  362.           directory and, with the BOX diskette in the A drive,
  363.           copy all BOX files to the directory as shown below:
  364.  
  365.                 C> MD\BOXX
  366.                 C> CD\BOXX
  367.                 C> COPY A:*.* C:
  368.  
  369.           The three commands above will create a new directory
  370.           named BOXX, change to that directory and copy all BOX
  371.           files from the BOX diskette to the BOXX directory on
  372.           the hard disk.  If you would prefer to leave the BOX
  373.           documentation and example programs on the disk then
  374.           substitute the following COPY statements for the one
  375.           above:
  376.  
  377.                 C> COPY A:BOX.EXE C:
  378.                 C> COPY A:BOXHELP.* C:
  379.                 C> COPY A:BOXLOGO. C:
  380.  
  381.  
  382.  
  383.           RUNNING BOX ON A HARD DISK SYSTEM
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.           =======================================================
  399.           BOX USER GUIDE                                 PAGE 7
  400.           =======================================================
  401.  
  402.           To start the BOX program, issue the following two
  403.           commands to change to the BOXX directory and initiate
  404.           the program:
  405.  
  406.                 C> CD\BOXX
  407.                 C> BOX
  408.  
  409.           Remember that BOX must be started from the same
  410.           directory and drive as its associated files.  You can
  411.           easily change the default path later.
  412.  
  413.  
  414.           THE MAIN MENU
  415.  
  416.           BOX is a snap to use because it uses the following
  417.           conventions which are standard with many popular
  418.           software products:
  419.  
  420.                 "Point and Shoot" Menus
  421.                 "Escape" for abort or return to menu
  422.                 "F1" for Help
  423.  
  424.           In fact, if you're in a hurry to try BOX, go ahead.
  425.           The program's user interface is intuitive and you will
  426.           likely be using all of BOX's features (except for BOX's
  427.           "on the fly" drawing changes which are well hidden)
  428.           without reading this manual.  However to get the most
  429.           from BOX it is a good idea to come back and read this
  430.           manual later to see if you may have missed a trick or
  431.           two.
  432.  
  433.           If you get stuck running BOX just hit F1 for help and
  434.           one of BOX's seven context-sensitive help screens will
  435.           appear.  These help screens are a condensed version of
  436.           this documentation.
  437.  
  438.           While we're talking about BOX's help screens it is
  439.           interesting to note that they were created with BOX and
  440.           are displayed by the same Pascal routines given in the
  441.           example programs on the diskette.
  442.  
  443.           When you start BOX the main menu will appear.  To
  444.           select an action from the menu move the lightbar with
  445.           the arrow keys and hit enter.  Or just hit the first
  446.           letter of item's description.  For example hit S if you
  447.           want to SAVE from the main menu.  Hitting the letter S
  448.           is equivalent to placing the lightbar on SAVE and
  449.           hitting enter.  After you become familiar with the
  450.           commands you probably will find this second approach
  451.           more efficient.
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.           =======================================================
  465.           BOX USER GUIDE                                 PAGE 8
  466.           =======================================================
  467.  
  468.  
  469.           Hitting the Esc while under one of BOX's menus will
  470.           abort that menu and take you to the next higher menu.
  471.           On the main menu however, hitting the Esc key will
  472.           cause an Exit from the BOX program (after a safety
  473.           prompt).
  474.  
  475.           EDIT MENU
  476.  
  477.           If you select EDIT MENU from the main menu, another
  478.           menu will appear with a list of selections for drawing
  479.           and painting boxes on the screen.  From the EDIT menu
  480.           you may :
  481.  
  482.                 Type labels and text on the screen
  483.                 Draw boxes like an etch-a-sketch
  484.                 Move around the screen without drawing
  485.                 Change background and foreground colors
  486.                 Move, clone and paint blocks of the screen
  487.                 Choose between four box drawing styles
  488.                 Repeat any character in any direction
  489.                 Paint the boxes any color (including blink)
  490.                 Erase lines drawn in error
  491.  
  492.  
  493.           These seven functions make it easy, even fun, to create
  494.           a screen image.  I'll return to the EDIT menu later and
  495.           cover each of the functions in detail.  But first let's
  496.           cover the other functions on the main menu.
  497.  
  498.           LOAD FROM DISK
  499.  
  500.           The LOAD function loads a screen image file you have
  501.           saved previously with the SAVE TO DISK function
  502.           described in the next section.  To load a file first
  503.           select the file format the original screen was saved
  504.           under; either ASCII, Memory or Packed (see description
  505.           under SAVE below).  BOX will then display a directory
  506.           of files on the current drive/path and prompt you for
  507.           the file name.  Type the file name you want to load and
  508.           hit enter.
  509.  
  510.           If the file you want to load is not on the current
  511.           drive/path you have two options.  First you may hit
  512.           escape to return to the main menu and there select
  513.           PATH/DIRECTORY to change the drive/path then return to
  514.           the LOAD screen to load the file.  Or you may simply
  515.           type the drive and directory prefix to the file name at
  516.           the bottom of the LOAD screen.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.           =======================================================
  531.           BOX USER GUIDE                                 PAGE 9
  532.           =======================================================
  533.  
  534.  
  535.           You may LOAD standard ASCII files created with other
  536.           editors (including Turbo Pascal's) and word processors.
  537.           But BOX will LOAD only the leftmost 80 characters of
  538.           the first 25 lines.  Take care not to LOAD a file
  539.           longer than 25 lines then SAVE it with the same name.
  540.           BOX will overwrite the original file but save only the
  541.           first 25 lines.  Any additional lines will be lost.
  542.  
  543.  
  544.           SAVE TO DISK
  545.  
  546.           The save function writes a disk file containing the
  547.           screen image you have created and edited with BOX's
  548.           DRAW and TYPE functions.  To use SAVE you must first
  549.           select the file format and, when prompted, provide a
  550.           file name.  Please note that BOX remembers the last
  551.           file name you used so BOX will SAVE the modified screen
  552.           under that same file name unless you change it.
  553.  
  554.  
  555.           ASCII FILE FORMAT
  556.  
  557.           With BOX you may store a screen image in one of three
  558.           different formats; the ASCII format, the Memory format
  559.           and the Packed format.
  560.  
  561.           The ASCII format is the simplest and most standard of
  562.           the three because it saves the screen in a text format
  563.           that most word processors and editors (including Turbo
  564.           Pascal's editor) recognize.  ASCII files may therefore
  565.           be further edited and printed with many other editors
  566.           and word processors or included directly in you
  567.           program's source code.
  568.  
  569.           However saving a BOX screen image in the ASCII format
  570.           has some disadvantages.  First, ASCII files lose all of
  571.           the color attributes you may have drawn or painted on
  572.           the screen.  In addition ASCII screen images must be
  573.           displayed line-by-line which results in a slower
  574.           display.
  575.  
  576.  
  577.           MEMORY FILE FORMAT
  578.  
  579.           Memory format files, because they are essentially a
  580.           snapshot "dump" of the video memory buffer, retain all
  581.           color attributes (including blink) and can be instantly
  582.           flashed on the screen using the code examples later in
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.           =======================================================
  597.           BOX USER GUIDE                                 PAGE 10
  598.           =======================================================
  599.  
  600.           this manual.  Memory files, however, will look like
  601.           gibberish to most editors and word processors.  Usually
  602.           this will present no problem since you can always edit
  603.           memory format files with BOX.
  604.  
  605.           Many of the commonly available screen-capture programs
  606.           use the Memory format.  GRAB.COM, a program contained
  607.           on the BOX disk, is a TSR (memory resident) screen-
  608.           capture program which you can use to capture screen
  609.           from other programs.  When activated with ALT-PrtSc,
  610.           GRAB saves the current screen image to the current disk
  611.           drive in a Memory format.   There are more instructions
  612.           for using GRAB in it own documentation file.
  613.  
  614.  
  615.           PACKED FILE FORMAT
  616.  
  617.           Except for one difference, Packed format files are
  618.           identical to Memory format files.  They retain all
  619.           color attributes and can be popped on the display
  620.           instantly.  The difference is that Packed format files
  621.           use a simple run-length-encoding algorithm to compress
  622.           the size of the file when it is written to the disk.
  623.           You can save considerable space by using Packed format
  624.           files if your screens have several blank lines or
  625.           bordered boxes.
  626.  
  627.           Memory format files always require 4000 bytes of
  628.           storage.  A typical Packed format file will require
  629.           around 2000 bytes.  You should be aware, however, that
  630.           in extreme cases (where every other character is
  631.           different for example) a Packed format file can
  632.           actually be larger than 4000 characters.  If you are
  633.           not sure which format to use, save your screen under
  634.           both formats with a different name then examine the
  635.           size of the files with a Directory command.
  636.  
  637.           Another consideration is that, because your Pascal
  638.           program must decode and expand the packed file (the
  639.           procedure is shown in the example programs) it takes
  640.           just a fraction of a second longer to load than a
  641.           Memory format file.  The difference is barely
  642.           perceptable even on slower 8086 computers.
  643.  
  644.           You must decide which of the three formats gives the
  645.           greatest advantage to your requirements.  Personally I
  646.           prefer the Memory format for its simplicity and
  647.           flexibility.
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.           =======================================================
  663.           BOX USER GUIDE                                 PAGE 11
  664.           =======================================================
  665.  
  666.           In saving BOX files you may use any file names you
  667.           wish.  Please note, however, that if you do not add
  668.           file extensions (a period followed by three characters
  669.           at the end of your file name) BOX will add them for you
  670.           using the following conventions:
  671.  
  672.                 ASCII files     xxxxxxxx.ASC
  673.                 Memory files    xxxxxxxx.MEM
  674.                 Packed files    xxxxxxxx.PAK
  675.  
  676.           If you choose to use the conventions above for your
  677.           file names, BOX will highlight any file names that
  678.           match the format you are using when it displays the
  679.           directory of files during LOADing.
  680.  
  681.           PATH/DIRECTORY
  682.  
  683.           With the PATH/DIRECTORY facility, which is available
  684.           from the Main menu, you can change the drive/path where
  685.           BOX will store or retrieve screen-image files.
  686.  
  687.  
  688.           CLEAR SCREEN
  689.  
  690.           The CLEAR SCREEN choice on the main menu brings up a
  691.           submenu with several screen-initialization functions.
  692.  
  693.              CLEAR
  694.  
  695.              The CLEAR function erases all characters on the
  696.              screen and sets the colors to those you have chosen.
  697.              Use it when you have just saved a screen image and
  698.              want to start with a fresh blank screen.
  699.  
  700.              COLOR CHANGE
  701.  
  702.              This choice on the CLEAR menu brings up a color
  703.              smorgasbord for selecting the colors you wish to
  704.              have on the cleared screen.
  705.  
  706.              FILL
  707.  
  708.              Select FILL to fill the entire screen with a
  709.              character.  An ASCII character selector box will pop
  710.              up to allow you to select any of the 255 ASCII
  711.              characters.  With these characters you can create
  712.              many interesting patterns.
  713.  
  714.              PAINT SCREEN
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.           =======================================================
  729.           BOX USER GUIDE                                 PAGE 12
  730.           =======================================================
  731.  
  732.  
  733.              PAINT changes the background and foreground colors
  734.              on the screen but does not erase the characters.
  735.  
  736.  
  737.           X EXIT
  738.  
  739.           Select EXIT on the main menu to leave the BOX program.
  740.           If your last step was to SAVE a file, BOX will return
  741.           control to DOS immediately.  However if your last
  742.           operation was not a SAVE, BOX will ask you if you
  743.           really want to EXIT.
  744.  
  745.  
  746.           THE EDIT MENU FUNCTIONS
  747.  
  748.           Now let's return to the EDIT MENU and examine each of
  749.           its functions in more detail.  When you select EDIT
  750.           from the main menu, BOX will display a list of
  751.           selections for drawing and painting boxes on the screen
  752.           including:
  753.  
  754.                 Type labels and text on the screen
  755.                 Draw boxes like an etch-a-sketch
  756.                 Move the cursor around the screen without drawing
  757.                 Change background and foreground colors
  758.                 Move or paint blocks on the screen
  759.                 Select from among four box drawing styles
  760.                 Repeat any character in any direction
  761.                 Paint the boxes any color (including blink)
  762.                 Erase lines drawn in error
  763.  
  764.  
  765.           Let's cover each of these functions in order:
  766.  
  767.           TYPE LABELS
  768.  
  769.           TYPE, which is the first function on the EDIT Menu, is
  770.           a simple, full-screen text editor you can use to type
  771.           text on a screen image.  After you have selected TYPE
  772.           simply locate the cursor where you want it on the
  773.           screen and type whatever text you need.  Since BOX
  774.           works with only one screen at a time the limits of the
  775.           typing area is 80 characters wide by 25 lines long -- a
  776.           full screen in 80 character text mode.
  777.  
  778.  
  779.           INSERT MODE
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.           =======================================================
  795.           BOX USER GUIDE                                 PAGE 13
  796.           =======================================================
  797.  
  798.           In the TYPE function you may toggle the insert mode on
  799.           and off by hitting the Ins. key.  A large block cursor
  800.           indicates that Insert is on, a small line cursor
  801.           indicates that Insert is off.  If Insert is on, all
  802.           characters to the right of the cursor will be pushed to
  803.           the right when you type.  BOX does not word wrap nor
  804.           does it save the characters that you push off the
  805.           screen.  Please remember that if you have the insert
  806.           mode on and you hit the enter key you will break the
  807.           line at the cursor location and carry the tail of the
  808.           line to a new line below.  If insert mode is off the
  809.           cursor will jump to the next line but it will not carry
  810.           the tail of the line.
  811.  
  812.  
  813.           DELETE LINE => F9
  814.  
  815.           To delete a line, place the cursor on the line you wish
  816.           to delete and hit F9.  All lines below the deleted line
  817.           are brought up one line and a blank line will be
  818.           inserted at the bottom of the screen.  The blank line
  819.           will be in the current color scheme.
  820.  
  821.  
  822.           INSERT LINE => F10
  823.  
  824.           To insert a blank line, place the cursor just below the
  825.           location you want the line inserted and hit F10.  All
  826.           lines below the inserted line will be pushed down one
  827.           and the last line of the screen will be lost.
  828.  
  829.  
  830.           DRAW BOXES
  831.  
  832.           Select DRAW BOXES from the DRAW MENU to draw lines and
  833.           boxes using the arrow keys on the cursor control pad.
  834.  
  835.           Think of DRAW as lowering a drawing pen onto the
  836.           drawing pad (the screen).  Lines will follow wherever
  837.           you direct the cursor--up, down, left or right. If you
  838.           cross another line special logic in BOX will
  839.           automatically draw the proper intersection or joining
  840.           character.  DRAW will use whatever colors and box style
  841.           you have previously selected.  So you may wish to
  842.           select COLOR CHANGE and BOX CHANGE from the DRAW MENU
  843.           before you select DRAW.
  844.  
  845.  
  846.           MOVE
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.           =======================================================
  861.           BOX USER GUIDE                                 PAGE 14
  862.           =======================================================
  863.  
  864.  
  865.           MOVE is the opposite of DRAW.  MOVE lifts the box-
  866.           drawing pen so that you may move the cursor with the
  867.           arrow keys to a new location without trailing a line
  868.           behind you.  When you have moved the cursor to the new
  869.           location, select DRAW to start drawing again. You may
  870.           also move the cursor without drawing if you select the
  871.           TYPE function from the menu.
  872.  
  873.  
  874.           COLOR CHANGE
  875.  
  876.           When you select COLOR CHANGE from the DRAW MENU a color
  877.           selection smorgasbord will appear on the screen.  To
  878.           select the colors you want simply use the up and down
  879.           arrow keys to select Foreground or Background and the
  880.           left and right arrow keys to select the color.  A small
  881.           arrow will move over the chart showing you which color
  882.           you have picked and a sample of the colors will appear
  883.           to the right of the display.
  884.  
  885.           Note that you may select from sixteen foreground and
  886.           sixteen background colors.  The second eight background
  887.           colors are not really colors but cause the foreground
  888.           characters to blink by turning on the blink bit in the
  889.           color attribute byte.  A little bit of blink, like hot
  890.           pepper sauce, goes a long way.
  891.  
  892.           The color combination you select will stay in effect
  893.           for the rest of the BOX session or until you change it
  894.           regardless of whether you are typing text, drawing
  895.           boxes or painting.
  896.  
  897.           Be sure you don't select the same background and
  898.           foreground colors.  If you do everything you draw or
  899.           type will be invisible.
  900.  
  901.  
  902.           BLOCK FUNCTIONS
  903.  
  904.           When you select BLOCK from the Draw menu, your first
  905.           step is to identify the portion of the screen, or the
  906.           block, you want to work with.  Do this by moving the
  907.           cursor to one corner of the block and hitting enter,
  908.           then moving the cursor to the opposite corner of the
  909.           block and hitting enter again.  After you anchor the
  910.           cursor on the first corner the program will highlight
  911.           the block area by displaying it in reverse video.
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.           =======================================================
  927.           BOX USER GUIDE                                 PAGE 15
  928.           =======================================================
  929.  
  930.           After you have identified the block size, the program
  931.           will display a submenu of functions.
  932.  
  933.              MOVE BLOCK
  934.  
  935.              If you select MOVE BLOCK from the BLOCK menu simply
  936.              use the cursor keys to move the identified block
  937.              around the screen until you have placed it where you
  938.              want it.  Hit enter to position the block.  The area
  939.              where the original block was located is blanked out.
  940.  
  941.              CLONE BLOCK
  942.  
  943.              CLONE BLOCK is the same as MOVE BLOCK except that
  944.              the original block is not blanked out but is left
  945.              intact.  So if you have created a fancy small
  946.              pattern in one area of the screen that you want to
  947.              repeat at other locations, use CLONE to move it.
  948.  
  949.              PAINT BLOCK
  950.  
  951.              PAINT allows you to change the background and
  952.              foreground colors of the selected block area of the
  953.              screen.  Other PAINT functions are more global and
  954.              operate on the interior of box lines, for example.
  955.              But BLOCK PAINT allows you to pinpoint just where
  956.              you want to change the colors.
  957.  
  958.              BLANK BLOCK
  959.  
  960.              This function blanks the selected area of the
  961.              screen.
  962.  
  963.              DEFINE NEXT BLOCK
  964.  
  965.              Use DEFINE to select another area of the screen for
  966.              block operations.
  967.  
  968.  
  969.           SELECT BOX-DRAWING STYLE
  970.  
  971.           Returning now to functions available from the main DRAW
  972.           menu, the SELECT BOX TYPE facility allows you to select
  973.           from among  double line, single line or combination
  974.           single/double line boxes.  Simply pick the one you
  975.           like.  The box type you select will stay in effect
  976.           until you change it even if you are not drawing.
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.           =======================================================
  993.           BOX USER GUIDE                                 PAGE 16
  994.           =======================================================
  995.  
  996.           REPEAT
  997.  
  998.           The REPEAT function has two parts.  First REPEAT will
  999.           allow you to enter the character you want to repeat.
  1000.           An ASCII character selection window will pop up on the
  1001.           right side of the screen.  Browse the ASCII table by
  1002.           using the Up and Down arrow keys and PageDown and
  1003.           PageUp keys.  Then hit enter to select.
  1004.  
  1005.           In the second step REPEAT will pause while you position
  1006.           the cursor anywhere on the screen.  When you have
  1007.           positioned the cursor where you want it, hit enter to
  1008.           trigger the REPEAT function.  You may now "draw" the
  1009.           repeat character any direction using the arrow keys.
  1010.           REPEAT works just like DRAW except you get to select
  1011.           any of the PC's 255 characters to draw with.
  1012.  
  1013.           Note that the character you select from the ASCII Table
  1014.           will stay at-the-ready for later Repeat-Drawing if you
  1015.           need it.  Just hit ALT-R to invoke the on-the-fly
  1016.           repeat function and you can "draw" the last-selected
  1017.           ASCII character in any direction.  The ASCII Table can
  1018.           also be brought up On-the-fly by hitting ALT-A.
  1019.  
  1020.  
  1021.           PAINT AREAS
  1022.  
  1023.           The PAINT function contains several choices for
  1024.           painting parts or all of the screen different colors.
  1025.  
  1026.              COLOR
  1027.  
  1028.              Before selecting any of the paint functions it is
  1029.              necessary to choose the background and foreground
  1030.              colors you want the painted area to be.  The COLOR
  1031.              smorgasbord allows the color selection.
  1032.  
  1033.              INTERIOR PAINT
  1034.  
  1035.              This function paints the interior of boxes but stops
  1036.              painting on the box boundary.  To use the function
  1037.              move the cursor inside the box to be painted and hit
  1038.              enter.  PAINT will start from the cursor position
  1039.              painting in every direction until it hits the box
  1040.              lines.  Make sure there are no gaps in the box
  1041.              because PAINT will leak through the gap and paint
  1042.              the entire screen.
  1043.  
  1044.              LINE PAINT
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057.  
  1058.           =======================================================
  1059.           BOX USER GUIDE                                 PAGE 17
  1060.           =======================================================
  1061.  
  1062.  
  1063.              This function will follow any boxes or lines you
  1064.              have drawn and paint them the color you have
  1065.              selected.  Put the cursor on the line you want to
  1066.              paint and hit enter.
  1067.  
  1068.              SCREEN PAINT
  1069.  
  1070.              Choose this function to change the colors of the
  1071.              entire screen.
  1072.  
  1073.              FILL
  1074.  
  1075.              The FILL function fills the area selected with a
  1076.              character of your choice.  When you select the
  1077.              function an ASCII selector table will pop up for
  1078.              character selection and you will be prompted to move
  1079.              the cursor inside the area to be filled.  FILL will
  1080.              not leak into or out of boxes.  The function is
  1081.              often used to create attractive background patterns
  1082.              around windows on the screen.
  1083.  
  1084.           These PAINT functions sounds complicated but play with
  1085.           them a while and you will get the hang of them right
  1086.           away.  Just remember that if you select the same
  1087.           background color that you have in the box to start
  1088.           with, PAINT will appear as if it is not working if
  1089.           there are no typed labels in the box.
  1090.  
  1091.           With the exception of the FILL function, the PAINT
  1092.           functions do not destroy characters you have typed on
  1093.           the screen.  They simply change the color attributes.
  1094.           This fact can be used to advantage if you want to leave
  1095.           the background color the same but change the
  1096.           foreground.  For example if you have white characters
  1097.           on a blue background and you wish to have yellow
  1098.           characters on the same blue background then simply
  1099.           select yellow on blue and paint the area you want to
  1100.           change.
  1101.  
  1102.           The PAINT functions test to see if they have completed
  1103.           their tasks by looking at the colors all around where
  1104.           they start.  If the colors there are the desired PAINT
  1105.           colors the function thinks it is done and does no
  1106.           further processing.  So be sure to move the cursor into
  1107.           an area that is not the paint color to start.
  1108.  
  1109.           If you have several areas to paint the same color move
  1110.           the cursor into the next area and hit ALT-P to invoke
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.           =======================================================
  1125.           BOX USER GUIDE                                 PAGE 18
  1126.           =======================================================
  1127.  
  1128.           the on-the-fly PAINT function.
  1129.  
  1130.  
  1131.           ERASE
  1132.  
  1133.           While you are drawing, sooner or later you will turn a
  1134.           corner too soon or make some other mistake.  To correct
  1135.           these mistakes, select ERASE.  In essence, ERASE writes
  1136.           a blank character wherever the cursor is directed.
  1137.           ERASE does not restore the background color to what it
  1138.           was before.  To accomplish this you must make a color
  1139.           change before you start ERASING.
  1140.  
  1141.  
  1142.  
  1143.           ON THE FLY CHANGES
  1144.  
  1145.           After you become familiar with the DRAW MENU functions
  1146.           and memorize the initials -- D for DRAW, M for MOVE and
  1147.           so on -- you will want to take advantage of the ON THE
  1148.           FLY CHANGES.  This facility allows you to change
  1149.           drawing functions on-the-fly while you are drawing
  1150.           simply by pressing a key.  When you use this feature
  1151.           there is no need to return to the menu and select
  1152.           another function.
  1153.  
  1154.           For example while you are drawing a box you can hit
  1155.           ALT-M and BOX immediately switches you into the MOVE
  1156.           function.  You may then move the cursor a few spaces,
  1157.           hit ALT-D and you're drawing a new box.  ON-THE-FLY
  1158.           functions are quick and powerful but they happen
  1159.           without fanfare so you will have to remember what you
  1160.           are doing.
  1161.  
  1162.           ON THE FLY functions duplicate those available from the
  1163.           menu except for PAINT and REPEAT which work slightly
  1164.           differently.  In their ON-THE-FLY forms PAINT and
  1165.           REPEAT are toggle functions you may turn on and off.
  1166.           For example if you are DRAWING you could hit ALT-M for
  1167.           MOVE, move the cursor inside a box and then hit ALT-P
  1168.           to toggle PAINT on and PAINT the box.  This procedure
  1169.           varies from the three-part PAINT and REPEAT sequence
  1170.           the program steps you through when these functions are
  1171.           selected from the menu.
  1172.  
  1173.                 ON-THE-FLY FUNCTIONS AVAILABLE
  1174.  
  1175.                         ALT-T = TYPE LABELS
  1176.                         ALT-D = DRAW BOXES
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.           =======================================================
  1191.           BOX USER GUIDE                                 PAGE 19
  1192.           =======================================================
  1193.  
  1194.                         ALT-M = MOVE
  1195.                         ALT-C = COLOR CHANGE
  1196.                         ALT-B = BLOCK FUNCTIONS
  1197.                         ALT-S = SELECT BOX TYPE
  1198.                         ALT-E = ERASE
  1199.                         ALT-A = ASCII TABLE
  1200.  
  1201.                         ALT-R = REPEAT (TOGGLE ONLY)
  1202.                         ALT-P = PAINT  (TOGGLE ONLY)
  1203.  
  1204.  
  1205.  
  1206.           ASCII TABLE (ALT-A)
  1207.  
  1208.           One unique on-the-fly function that is not directly
  1209.           available from the menu (it is available indirectly
  1210.           from the REPEAT function) is the ASCII Table.  If you
  1211.           want to use one of the upper or lower ASCII characters
  1212.           which cannot be entered from the keyboard on the
  1213.           screen, simply hit ALT-A.  An ASCII Table will pop up
  1214.           on the right side of the screen with a selector box
  1215.           that you move with the arrow keys.  Move the selector
  1216.           box over the character you want, scrolling with the
  1217.           arrow keys or PageDown or PageUp if necessary, then hit
  1218.           enter to select.  The ASCII table will disappear and
  1219.           the character you selected will be printed on the
  1220.           screen at the last cursor position.
  1221.  
  1222.           The ASCII character you last selected from the ASCII
  1223.           table will stay at-the-ready to be used in the REPEAT
  1224.           function.  To select the on-the-fly REPEAT function hit
  1225.           ALT-R.  This combination of ASCII Table selection and
  1226.           REPEAT is a very powerful facility to create
  1227.           interesting and unusual effects with some of the
  1228.           "strange" ASCII characters.  Some amazing displays can
  1229.           be created using the block and shading characters in
  1230.           unusual color combinations.  The possibilities for
  1231.           attention-getting program logo screens are endless.
  1232.  
  1233.  
  1234.  
  1235.           TURBO PASCAL PROGRAMMING CONSIDERATIONS
  1236.  
  1237.           Creating screen images with BOX is easy and fun but it
  1238.           is only half the story.  The real payoff comes when you
  1239.           integrate the screens into your own Turbo Pascal
  1240.           program.
  1241.  
  1242.           Displaying and using BOX-created screens in your Turbo
  1243.           Pascal programs is relatively easy.  The Pascal Unit
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.  
  1252.  
  1253.  
  1254.  
  1255.  
  1256.           =======================================================
  1257.           BOX USER GUIDE                                 PAGE 20
  1258.           =======================================================
  1259.  
  1260.           LOADFILE.PAS contains source code you can use to load
  1261.           any of the three BOX format screens onto the display.
  1262.  
  1263.           DISPLAYING ASCII FORMAT SCREENS
  1264.  
  1265.           To display ASCII format screens created with the BOX
  1266.           editor, add a procedure to your program which reads the
  1267.           file produced by BOX and displays it line by line.  The
  1268.           following logic, a simplified version of Procedure
  1269.           Load_ASCII in Unit LOADFILE.PAS, will give you the
  1270.           idea.
  1271.  
  1272.           VAR
  1273.                 FilevarA   : Text;
  1274.           BEGIN
  1275.                 Assign(FilevarA,'ANYFILE.ASC');
  1276.                 Reset(FilevarA);
  1277.                 ClrScr;
  1278.                 For II := 1 to 25 do
  1279.                   Begin
  1280.                     Readln(FilevarA,TempStr);
  1281.                     GoToXY(1,II);
  1282.                     Write(TempStr);
  1283.                   End;
  1284.                 Close(FilevarA);
  1285.           END;
  1286.  
  1287.  
  1288.           The example above will load BOX ASCII format file
  1289.           ANYFILE.ASC onto the display.  Copy and use the
  1290.           procedure above or the more flexible procedure given in
  1291.           Unit LoadFile in your own programs.
  1292.  
  1293.           DISPLAYING MEMORY FORMAT SCREENS
  1294.  
  1295.           Displaying a memory format screen requires a bit of
  1296.           fiddling with the PC's video buffer.  Forturnately you
  1297.           don't have to know how it works because We've included
  1298.           all the routines you need in Units IOSTUFF and
  1299.           LOADFILE.
  1300.  
  1301.           However for those that are curious here's a few
  1302.           technical details.  To display a screen you have saved
  1303.           under the memory format you must read in the BOX-
  1304.           created file and move the contents of the file directly
  1305.           into the Video display memory buffer.  This buffer is
  1306.           located at memory address B800 (hex) for the color (CGA
  1307.           or EGA) adapters and at memory address B000 (hex) for
  1308.           the monochrome adapter.  So the logic to display a
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.           =======================================================
  1323.           BOX USER GUIDE                                 PAGE 21
  1324.           =======================================================
  1325.  
  1326.           memory file is as shown below:
  1327.  
  1328.           TYPE
  1329.              Map     = Record     { one char. and color attr.}
  1330.                            ScrCh : Char;
  1331.                            ScrAt : Byte;
  1332.                          End;
  1333.              Screen  = Array[1..25,1..80] of Map; {video memory}
  1334.  
  1335.           VAR
  1336.               FilevarM   : File;
  1337.               LoadScr    : Screen;  {holding screen}
  1338.               ColorScr   : Screen absolute $B800:0000; {color}
  1339.               MonoScr    : Screen absolute $B000:0000; {Mono}
  1340.  
  1341.           BEGIN
  1342.               Assign(FilevarM,'ANYFILE.MEM');
  1343.               Reset(FilevarM,4000);
  1344.               BlockRead(FilevarM,LoadScr,1); {read in the screen}
  1345.                                            {now move into buffer}
  1346.               Move(LoadScr,ColorScr,4000);   {For CGA}
  1347.           {   Move(LoadScr,MonoScr,4000);  } {For Monochrome}
  1348.               Close(FilevarM);
  1349.               ...
  1350.           END;
  1351.  
  1352.           The example above first reads memory format file
  1353.           ANYFILE.MEM into holding area LoadScr.  Then LoadScr is
  1354.           moved directly into the CGA display memory.  The
  1355.           bracketed statements show how the logic would be
  1356.           changed to display the screen on a monochrome display.
  1357.           When you move the file into the video buffer the screen
  1358.           image will pop onto the display almost instantly.
  1359.  
  1360.           Moving data directly into the CGA adapter's memory will
  1361.           cause interference or "snow" on the screen.  The
  1362.           interference happens so fast that it is not particulary
  1363.           objectionable.  However there is a way to avoid the
  1364.           snow by using MoveToScreen, a special inline code
  1365.           routine given in Unit IOSTUFF.  There are also routines
  1366.           in IOSTUFF which determine the type of adapter
  1367.           installed so that your programs will work on any kind
  1368.           of computer.  I recommend you consider using the
  1369.           Load_Mem Procedure in Unit LOADFILE.PAS to take
  1370.           advantage of the advanced functionality.  If you
  1371.           include these Units the logic to display a screen is
  1372.           dead simple:
  1373.  
  1374.                 Load_Mem('ANYFILE.MEM');
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.           =======================================================
  1389.           BOX USER GUIDE                                 PAGE 22
  1390.           =======================================================
  1391.  
  1392.  
  1393.           This statement will pop BOX file ANYFILE.MEM on the
  1394.           screen regardless of type of display.  The screen will
  1395.           appear just as you created it with BOX -- boxes,
  1396.           colors, blink and all.  After you have displayed the
  1397.           screen you are free to write on it with normal Pascal
  1398.           Write statements.
  1399.  
  1400.  
  1401.           DISPLAYING PACKED FORMAT SCREENS
  1402.  
  1403.           Displaying a Packed format screen is similar to
  1404.           displaying a Memory format screen except the packed
  1405.           screen file must be unpacked before it can be
  1406.           displayed.  A Packed format file uses a simple run
  1407.           length encoding structure.  The idea is that if there
  1408.           are 20 blanks in a row on the screen, the Packed format
  1409.           just saves the blank character once along with the run
  1410.           length of 20.  Here's a snippet of logic to show you
  1411.           how to unpack a packed screen image:
  1412.  
  1413.           TYPE
  1414.  
  1415.              Map     = Record     { one char. and color attr.}
  1416.                            ScrCh : Char;
  1417.                            ScrAt : Byte;
  1418.                          End;
  1419.  
  1420.              Screen  = Array[1..25,1..80] of Map; {video memory}
  1421.  
  1422.              Pack  = Record
  1423.                       PackNm : Byte;  {run length}
  1424.                       PackCh : Char;  {repeated character}
  1425.                       PackAt : Byte;  {repeated attribute}
  1426.                      End;
  1427.  
  1428.           VAR
  1429.              FilevarM   : File;
  1430.              LoadScr    : Screen;
  1431.              ColorScr   : Screen absolute $B800:0000; {color}
  1432.              MonoScr    : Screen absolute $B000:0000; {Mono}
  1433.              Packbuf    : Array[1..2000] of Pack;
  1434.              II,JJ,Sloc,SX,SY,NumRec  : Integer;
  1435.  
  1436.           BEGIN
  1437.              Sloc := 1;              {SLoc is location on screen}
  1438.              Assign(FilevarM,'ANYFILE.PAK');
  1439.              Reset(FilevarM);
  1440.              BlockRead(FilevarM,PackBuf,48,NumRec);
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.           =======================================================
  1455.           BOX USER GUIDE                                 PAGE 23
  1456.           =======================================================
  1457.  
  1458.              JJ := 0;
  1459.              While Sloc < 2001 do
  1460.                 Begin                 {start unpacking}
  1461.                     JJ := JJ + 1;
  1462.                     For II := 1 to Packbuf[JJ].PackNm do
  1463.                      Begin
  1464.                       SY := (SLoc-1) div 80 + 1;       {row}
  1465.                       SX := (SLoc-1) mod 80 + 1;       {column}
  1466.                           {move in the character and attribute}
  1467.                       LoadScr[SY,SX].ScrCh := Packbuf[JJ].PackCh;
  1468.                       LoadScr[SY,SX].ScrAt := Packbuf[JJ].PackAt;
  1469.                       Inc(SLoc);  {increment the screen location}
  1470.                      End;
  1471.                 End;
  1472.              Move(LoadScr,ColorScr,4000); {for CGA}
  1473.           {  Move(LoadScr,MonoScr,4000);} {for Mono}
  1474.              Close(FilevarM);
  1475.           END;
  1476.  
  1477.  
  1478.           After the Packed format file has been unpacked it looks
  1479.           just like a Memory format file and may then be moved
  1480.           directly into the video memory buffer as shown in the
  1481.           move statements above.  The example procedure LOAD_PAK
  1482.           contained on your disk in file LOADFILE.PAS is a more
  1483.           comprehensive example of the technique and is ready to
  1484.           use in your own programs.
  1485.  
  1486.  
  1487.           USING BOX SCREENS FOR CONTEXT SENSITIVE HELP
  1488.  
  1489.           It is relatively easy to create a context-sensitive
  1490.           help facility in your Turbo Pascal program with the BOX
  1491.           screen editor and a few simple routines such as those
  1492.           contained on the BOX diskette in file KEY2.PAS.
  1493.  
  1494.           The first step is to decide how many help screens you
  1495.           need and during what processing steps you want the help
  1496.           screens to display.  Now use the BOX editor to create
  1497.           each of the help screens.  You may enter text, draw
  1498.           lines, use different colors and get as fancy as you
  1499.           wish.  After you have completed each help screen save
  1500.           it using a memory or packed format.
  1501.  
  1502.           Now turn to your Turbo Pascal program.  You will need
  1503.           to make a decision and then make several minor
  1504.           additionsto your program to tailor the help facility.
  1505.           The decision is where you are going the store the help
  1506.           screen images.  You have three choices;
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.  
  1516.  
  1517.  
  1518.  
  1519.  
  1520.           =======================================================
  1521.           BOX USER GUIDE                                 PAGE 24
  1522.           =======================================================
  1523.  
  1524.  
  1525.           (1) leave the files on disk and bring them in when
  1526.           needed,
  1527.           (2) preload the files into an array defined in your
  1528.           program's storage or
  1529.           (3) preload screens on unallocated memory (the heap).
  1530.  
  1531.           The first apprach is simple, clean and saves memory but
  1532.           it is comparitively slow.  The second and third
  1533.           approaches take more memory but allow eyepopping speed.
  1534.           We use alternative three (store help screens on the
  1535.           heap) in the BOX program.
  1536.  
  1537.           To copy this approach first examine the help-related
  1538.           procedures in Unit KEY2.PAS.  You must first call
  1539.           Procedure SETHELPMAX to set the number of active help
  1540.           screens you intend to use.  Then you must call
  1541.           Procedure HELPLOAD once for each help screen to store
  1542.           the screen on the heap.  Here's the actual help-loading
  1543.           statements we use in BOX.
  1544.  
  1545.            Display('Loading Help Files',1,25);
  1546.            SetHelpMax(7);
  1547.            HelpLoad(1,'BoxHelp.1');
  1548.            HelpLoad(2,'BoxHelp.2');
  1549.            HelpLoad(3,'BoxHelp.3');
  1550.            HelpLoad(4,'BoxHelp.4');
  1551.            HelpLoad(5,'BoxHelp.5');
  1552.            HelpLoad(6,'BoxHelp.6');
  1553.            HelpLoad(7,'BoxHelp.7');
  1554.            Wait;
  1555.  
  1556.           These statements establish seven help screens and load
  1557.           the actual screens in order on the heap.  The numbers
  1558.           are important because they establish the "context"
  1559.           under which the screen will be displayed.
  1560.  
  1561.           To use the concept of contextual help, assign values to
  1562.           the global variable HELPCONTEXT (defined in Unit KEY2)
  1563.           at various locations in your program corresponding to
  1564.           the help screen you want to display.  For example if
  1565.           the help screen for your EDIT function is EDITHELP.MEM
  1566.           and you have assigned it position No. 2 on the heap
  1567.           through the statement HelpLoad(2,'EDITHELP.MEM'); then
  1568.           be sure to set HELPCONTEXT := 2; in the first few
  1569.           statements of your EDIT Procedure.
  1570.  
  1571.           Now all that's left is to intercept each keystroke as
  1572.           it is entered and check it to see if the user has
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.  
  1583.  
  1584.  
  1585.  
  1586.           =======================================================
  1587.           BOX USER GUIDE                                 PAGE 25
  1588.           =======================================================
  1589.  
  1590.           pressed F1 (or whatever you wish the help key to be).
  1591.           If the user has pressed the help key then your program
  1592.           should pop the appropriate help screen on the display.
  1593.           Function NEXTKEY in Unit KEY2 does this for you.  As
  1594.           long as you read in characters with function NEXTKEY,
  1595.           and keep variable HELPCONTEXT set, the routines in Unit
  1596.           KEY2 will do all the work.  The right help screen will
  1597.           flash on the monitor and, when the user hits a key,
  1598.           will disappear leaving him at the exact spot he was
  1599.           when he asked for help.
  1600.  
  1601.           This business of context sensitive help sounds
  1602.           complicated but it is not.  Study the complete example
  1603.           program ADDRESS.PAS to see how it is done.
  1604.  
  1605.  
  1606.           ADDRESS.PAS, A COMPLETE EXAMPLE PROGRAM
  1607.  
  1608.           ADDRESS.PAS on the BOX diskette is a complete Turbo
  1609.           Pascal example program that uses BOX screens in three
  1610.           different ways:
  1611.  
  1612.                 Program Logo screen
  1613.                 Context sensitive help screens
  1614.                 Database entry screen
  1615.  
  1616.           ADDRESS is a simple name and address manager that
  1617.           allows the user to browse, add, change or delete
  1618.           entries from a list of addresses.  The actual database
  1619.           management portion of ADDRESS is simple and
  1620.           unsophisticated to keep the program small.  Rather the
  1621.           emphasis is on the examples of using the BOX screens
  1622.           effectively.
  1623.  
  1624.           The ADDRESS program references several Units from
  1625.           Nescatunga Software's Turbo Overdrive Package, a
  1626.           collection of over 40 procedures and functions.  The
  1627.           Units which are included on the BOX diskette are:
  1628.  
  1629.             IOSTUFF.PAS  -- Low level screen and cursor routines
  1630.             LOADFILE.PAS -- Load BOX screen onto the display
  1631.             MENUBOX.PAS  -- Popup menu window
  1632.             GETLNE.PAS   -- Take user's input from the screen
  1633.             KEY.PAS      -- Keystroke reading and help routines
  1634.  
  1635.           We think you will find these Units extremely powerful
  1636.           and useful.  IOSTUFF alone is worth the price of BOX.
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.           =======================================================
  1653.           BOX USER GUIDE                                 PAGE 26
  1654.           =======================================================
  1655.  
  1656.           CAPTURING SCREENS FROM OTHER PROGRAMS WITH GRAB
  1657.  
  1658.           On the BOX disk you will find the program GRAB.COM, a
  1659.           memory-resident screen capturing program.  GRAB is a
  1660.           program that, when activated by pressing the ALT key
  1661.           and the PrtSc key simultaneously, saves the current
  1662.           screen image to disk under BOX's Memory format.  You
  1663.           can use GRAB to capture screens from other programs and
  1664.           later modify those screens using the BOX editor and
  1665.           incorporate the screens into your own programs.
  1666.  
  1667.           To use GRAB first run the program by typing GRAB at the
  1668.           DOS prompt.  GRAB will print a short message confirming
  1669.           that it has been loaded.  You may now proceed to run
  1670.           any other program you wish.  Whenever you want to save
  1671.           the screen image hit the ALT-PrtSc keys and GRAB will
  1672.           create a Memory format file containing the screen image
  1673.           on the current disk drive.  If the drive or directory
  1674.           has been changed by the program or the batch file, GRAB
  1675.           will write to the new drive and directory.  Later you
  1676.           can copy the files to whatever directory you wish.  It
  1677.           is a good idea to wait until the program you are
  1678.           running is stable (i.e. waiting for a keystroke) before
  1679.           trying to capture the screen.
  1680.  
  1681.           When GRAB saves the screen it assigns a file name using
  1682.           the convention BOXnnn.MEM.  The nnn portion of the file
  1683.           name starts with 000 and is incremented by one for each
  1684.           file saved.  So the first file will be named
  1685.           BOX000.MEM, the second BOX001.MEM and so on.
  1686.  
  1687.           GRAB saves files only in the Memory format but it is
  1688.           easy to covert the file format later with BOX.  Simply
  1689.           LOAD the file using a Memory format and SAVE the file
  1690.           using an ASCII or Packed format.